package com.rox.el;
import javax.swing.*;

import java.awt.*;
import java.awt.event.*;

public class Menu{

	private Dimension size = new Dimension(250,300);
	JFrame frame;
	
	public static void main(String[] args){
		new Menu();
		
	}
	
	public Menu(){
		frame = new JFrame("Menu");
		frame.setSize(size);
		frame.setResizable(false);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setLocationRelativeTo(null);
		
		JPanel p = new JPanel();
		p.setLayout(new BoxLayout(p,BoxLayout.Y_AXIS));
		
		JButton notRandom = new JButton("Not Random");
		notRandom.setAlignmentX(Component.CENTER_ALIGNMENT);
		notRandom.addActionListener(new NotRListener());
		JButton random = new JButton("Random");
		random.setAlignmentX(Component.CENTER_ALIGNMENT);
		random.addActionListener(new RListener());
		
		JButton adder = new JButton("Adder");
		adder.setAlignmentX(Component.CENTER_ALIGNMENT);
		adder.addActionListener(new AddListener());
		frame.add(p);
		p.add(Box.createRigidArea(new Dimension(0,45)));
		p.add(notRandom);
		p.add(Box.createRigidArea(new Dimension(0,35)));
		p.add(random);
		p.add(Box.createRigidArea(new Dimension(0,35)));
		p.add(adder);
		
		frame.setVisible(true);
		
	}
	
	class NotRListener implements ActionListener{

		@Override
		public void actionPerformed(ActionEvent e) {
			new Main();
			frame.setVisible(false);
		}
		
		
	}
	class RListener implements ActionListener{

		@Override
		public void actionPerformed(ActionEvent e) {
			new MainR();
			frame.setVisible(false);
			
		}
		
		
	}
	
	class AddListener implements ActionListener{

		@Override
		public void actionPerformed(ActionEvent e) {
			new adder();
			frame.setVisible(false);
			
		}
		
		
	}
}
